<?php
/**
 * Copyright (C), 2016-2018, Shall Buy Life info. Co., Ltd.
 * FileName: Business.php
 * Description: 说明
 *
 * @author lwl
 * @Create Date    2021/6/9 14:52
 * @Update Date    2021/6/9 14:52 By lwl
 * @version v1.0
 */

namespace Example\Models;

use Example\Filters\QueryFilter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Business extends BasicModel
{
    use SoftDeletes;

    public function __construct(array $attributes = [])
    {
        $this->_name = $this ;
        parent::__construct($attributes);
    }
    public function scopeFilter($query, QueryFilter $filters)
    {
        return $filters->apply($query);
    }

    protected $table = 'life_business_school_business';

    protected $fillable = ['name', 'number', 'created_at', 'updated_at'];//parent_id


    /**
     * FunctionName：accessRight
     * Description：业务对应的权限
     * Author：lwl
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function accessRight():\Illuminate\Database\Eloquent\Relations\HasMany
    {
        return $this->hasMany(AccessRight::class);
    }
}
